<?php
class RoleFilterPost{
	public $role;
	public $sub_bagian;
	
	public function RoleFilterPost(){
		$role = array();
		$sub_bagian = array();
		// role
		foreach($_POST as $k=>$v){
			if( strpos($k, 'role-') !== false ){
				$index = substr($k, strpos($k, '-')+1);
				
				$sub_bagian[$index-1] = $_POST['sub_bagian-'.$index];
				$role[$index-1]   = $v;
			}
		}		
		
	
		$this->sub_bagian 	= $sub_bagian;
		$this->role 		= $role;
	}
}
?>